package com.sdhs.analyze.service;

import com.sdhs.analyze.bean.InfoMessage;
import com.sdhs.analyze.bean.InfoUserMessage;
import com.sdhs.analyze.dao.InfoUserMessageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class InfoUserMessageService {

    @Autowired
    private InfoUserMessageMapper infoUserMessageMapper;

    @Transactional
    public void insertMessage(InfoMessage record){
        infoUserMessageMapper.insertMessage(record);
    }

    @Transactional
    public void insertUserMessage(InfoUserMessage record){
        infoUserMessageMapper.insertUserMessage(record);
    }

    @Transactional
    public void updateMessage(String nodeId, String nodeType){
        infoUserMessageMapper.updateMessage(nodeId,nodeType);
    }

    @Transactional
    public void updateUserMessage(Integer messageId){
        infoUserMessageMapper.updateUserMessage(messageId);
    }

    public List<Integer> selectUserByOrgId(String orgId, Integer orgType){
        return infoUserMessageMapper.selectUserByOrgId(orgId,orgType);
    }

    public InfoMessage  selectMessage(String nodeId, String nodeType){
        return infoUserMessageMapper.selectMessage(nodeId, nodeType);
    }

}
